package com.example.testhooter;

import java.io.File;
import java.io.FileOutputStream;
import java.io.Serializable;
import java.util.Map;

import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;

@SuppressWarnings({ "unused", "serial" })
public class Play implements Serializable {
	private Map<Integer, String> cat_list;
	private Map<Integer, String> sub_cat_list;
	private int cat_id, sub_cat_id;
	private String cat_name, sub_cat_name, test_name;

	public Play() {

	}

	/*
	 * sample methods for serializable public String gets(){ return cat_name; }
	 * public void sets(){ cat_name="yishu"; }
	 */
	public boolean isFirstTime(Context context) {
		int flag = 0;
		
		try {
			File mydir = context.getDir("TestHooter", Context.MODE_PRIVATE);
			File fileWithinMyDir = new File(mydir, "TestHooter1.chk");
			if(fileWithinMyDir.exists()){				
				flag=0;
			}
			else{
				fileWithinMyDir.createNewFile();
				Log.v("new","heheh");
				FileOutputStream out = new FileOutputStream(fileWithinMyDir);			
				out.write(Byte.valueOf("1"));
				out.close();				
				flag=1;
			}
			
		} catch (Exception e) {

		}		
		return flag==1?true:false;				
	}

	public void initialize() {

	}

	public void getCategory() {
		Category cat = new Category();
		cat_list = cat.getCategories();
	}

	public void getSubCategory(int cat_id) {
		Category cat = new Category();
		sub_cat_list = cat.getSubCategories(cat_id);
	}

}

